//
//  SADataShareListTableViewCell.m
//  SunOn
//
//  Created by RazeenCheng on 2017/5/2.
//  Copyright © 2017年 NeoZhang. All rights reserved.
//

#import "SADataShareListTableViewCell.h"

@interface SADataShareListTableViewCell ()

@property (nonatomic, strong) NSIndexPath *indexPath;

@end



@implementation SADataShareListTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}


- (void)configCellWithIndexPath:(NSIndexPath *)indexPath
{
    
    self.indexPath = indexPath;
    
    NSInteger section = indexPath.section;
    NSInteger row = indexPath.row;
    
    switch (section) {
        case 0:
        {
            if (row == 1) {
                self.leftTitleLabel.text = @"月度、半年度、年度";
                self.leftDescriptionLabel.text = @"销售数据分析";
                self.rightTitleLabel.text = @"相关区域";
                self.rightDescriptionLabel.text = @"销售数据分析";
            } else {
                self.leftTitleLabel.text = @"单品数据分析";
                self.leftDescriptionLabel.text = @"关于单品数据的分析";
                self.rightTitleLabel.text = @"其他分析";
                self.rightDescriptionLabel.text = @"其他分类分析";
            }
        }
            break;
            
        case 1:
        {
            if (row == 1) {
                self.leftTitleLabel.text = @"产品培训共享";
                self.leftDescriptionLabel.text = @"销售数据分析";
                self.rightTitleLabel.text = @"新品资料";
                self.rightDescriptionLabel.text = @"销售数据分析";
            } else {
                self.leftTitleLabel.text = @"其他";
                self.leftDescriptionLabel.text = @"关于单品数据的分析";
                self.rightTitleLabel.text = @"";
                self.rightDescriptionLabel.text = @"";
            }
        }
            break;
            
        case 2:
        {
            if (row == 1) {
                self.leftTitleLabel.text = @"同业公司简介";
                self.leftDescriptionLabel.text = @"销售数据分析";
                self.rightTitleLabel.text = @"相关产品对比";
                self.rightDescriptionLabel.text = @"销售数据分析";
            }
        }
            break;
            
        default:
            break;
    }
    
    
    // @"月度、半年度、年度",@"销售数据分析"
    // @"相关区域",@"销售数据分析"
    // @"单品数据分析",@"关于单品数据的分析"
    // @"其他分析",@"其他分类分析"
    
    // @"产品培训共享",@"销售数据分析"
    // @"新品资料",@"销售数据分析"
    // @"其他",@"关于单品数据的分析"
    
    // @"同业公司简介",@"销售数据分析"
    // @"相关产品对比",@"销售数据分析"
}


- (IBAction)leftButtonClick:(id)sender
{
    if (self.detailAction) {
        self.detailAction(0);
    }
}


- (IBAction)rightButtonClick:(id)sender
{
    if (self.indexPath.section == 1 && self.indexPath.row == 2) {
        NSLog(@"是空的");
        return;
    }
    
    if (self.detailAction) {
        self.detailAction(1);
    }
}


@end
